package com.blt.govdata.controller;

import com.blt.govdata.controller.base.BaseController;
import com.blt.govdata.core.annotation.Loggable;
import com.blt.govdata.service.IProjectBasicInfoService;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.ObjectArrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Calendar;
import java.util.Map;

/**
 * Created with IntelliJ IDEA
 * Description:审核管理前端控制器
 * Author:GongJun
 * Date:2018/3/27
 * Time:18:00
 * blt Technologies Co., Ltd.
 */
@RestController
@RequestMapping("/projectBasicInfo")
public class ProjectBasicInfoController extends BaseController {

    @Autowired
    IProjectBasicInfoService service;

    /**
     * 项目情况
     * */
    @RequestMapping(value = "/getProjectInfo",params = {"id"})
    public Map<String, Object> getProjectInfo(@RequestParam Map<String, Object> params,Integer id) {
        params.put("id",id);
        if(null == params.get("year")) params.put("year", Calendar.getInstance().get(Calendar.YEAR));

        Map<String,Object> result = Maps.newHashMap();
        //项目基本情况
        result.put("projectBasicInfo", this.service.projectBasicInfo(params));
        //项目进展情况
        result.put("projectProgressInfo", this.service.projectProgressInfo(params));
        //项目存在的问题和困难
        result.put("existFaq", this.service.existFaq(params));
        //下一步措施
        result.put("nextMeasure", this.service.nextMeasure(params));
        //工作进展
        result.put("workProgress",  this.service.workProgress(params));
        //土地利用情况
        result.put("landUsageInfo", this.service.landUsageInfo(params));
        //年度计划
        result.put("yearPlan", this.service.yearPlan(params));
        //督办情况
        result.put("rigorousSituation", this.service.rigorousSituation(params));

        return ImmutableMap.of("status","true","data",result);

    }




    /**
     * 土地利用情况
     */
    @RequestMapping(value = "/landUsageInfo")
    public Map<String, Object> landUsageInfo(@RequestParam Map<String, Object> params) {
        return ImmutableMap.of("status", "true", "data", this.service.landUsageInfo(params));
    }

    /**
     * 年度计划
     */
    @RequestMapping(value = "/yearPlan")
    public Map<String, Object> yearPlan(@RequestParam Map<String, Object> params) {
        return ImmutableMap.of("status", "true", "data", this.service.yearPlan(params));
    }

    /**
     * 月度计划
     */
    @RequestMapping(value = "/monthPlan")
    public Map<String, Object> monthPlan(@RequestParam Map<String, Object> params) {
        return ImmutableMap.of("status", "true", "data", this.service.monthPlan(params));
    }

    /**
     * 督办情况
     */
    @RequestMapping(value = "/rigorousSituation")
    public Map<String, Object> rigorousSituation(@RequestParam Map<String, Object> params) {
        return ImmutableMap.of("status", "true", "data", this.service.rigorousSituation(params));
    }
}
